<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet"
	href="/css/yaodian100_header_v5.css" type="text/css" />
<link rel="stylesheet" href="/css/yaodian100_reg_v2.css"
	type="text/css" />
<link rel="stylesheet" href="/css/mgm_111128.css"
	type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>寄送礼券．耀点100</title>
<script type="text/javascript">
var result = "${result}";
if("error"==result){
	$(function() {
		$("#tabs").tabs();
		$("#dialogError").dialog({
			bgiframe: true,
			width:400,
			modal: true
		});
		$('#test').tooltip();
	});

}
if("right"==result){
	$(function() {
		$("#tabs").tabs();
		$("#dialogRepeat").dialog({
			bgiframe: true,
			width:400,
			modal: true
		});
		$('#test').tooltip();
	});
	
}



function addMail(id){
//	alert('改变email');
	var reg = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi;
	var email = document.getElementById(id).value;
	if(reg.test(email)){
		
//	alert('正确的email');
	}else{
		alert('错误的email');
		return false;
	}
//	alert('End');
}

function submit(){
	
	document.getElementById("mgmForm").submit();
}
function close(){
	window.location.href="indexMgm.do";
}
function aaa(){
	
//	$("#dialogError").close();
//	document.getElementByIdx( "dialogError").style.display = "none";
//	$(dialogError).hide();
}

</script>
</head>
<body>
	<div id="container">
		<form action="addSendMgmInfo.do" method="post" id="mgmForm">

			<div id="main" class="mgm-send">
				<div>
					<img src="/images/mgm/P03_01.jpg" /><img
						src="/images/mgm/P03_02.jpg" /><img
						src="/images/mgm/P03_03.jpg" /><img
						src="/images/mgm/P03_04.jpg" />
				</div>
				<ul class="coupon-list">
					<c:forEach items="${list}" var="list" varStatus="i">
						<li><input name="userToEmail" id="${list.id }" type="text" class="ipt-email" onblur="addMail('${list.id }')"/><input
							name="userName" type="text" class="ipt-name" id="${i.index }" /><input
							type="hidden" name="coupon" value="${list.couponId }" /></li>

					</c:forEach>

				</ul>

				<p class="c-f" align="center">
					<a href="javascript:submit()"><br /><img
						src="/images/mgm/btn_send.jpg" /> </a>
				</p>
				<img src="/images/mgm/P03_07.jpg" />
			</div>
		</form>
	</div>
	 <DIV id="dialogError" title="错误" class="dailog-ok" style="display:none;" >
         <p class="txt-m">亲！你填写的不正确哟，请重新填写！</p>
</DIV>
 <DIV id="dialogRepeat" title="成功" class="dailog-ok" style="display:none;" >
         <p class="txt-m">亲！你的礼券已送出，快去通知好友吧！</p>
         <div align="center"><a href="javascript:close()" class="btn-mid" onfocus="blur()">确定</a></div>
</DIV>
</body>
</html>